package mips.instructions.fpu;

import mips.instructions.Instruction;

/**
 * <code>COP1W</code> instruction type handler<br/>
 * @author jnmartin84@gmail.com
 */
public class COP1W extends Instruction {

	private static final COP1W INSTANCE = new COP1W();
	private static final String INSTRUCTION_NAME = "COP1W";

	private COP1W(){}

	public static final COP1W getInstance() {
		return INSTANCE;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public final void execute(int instruction) throws Exception {
		Instruction.getCop1W(Instruction.FUNCTION(instruction)).execute(instruction);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public final String emit(final int instruction) {
		return Instruction.getCop1W(Instruction.FUNCTION(instruction)).emit(instruction);
	}
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public final String getName(final int instruction) {
		return Instruction.getCop1W(Instruction.FUNCTION(instruction)).getName(instruction);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public final String getName() {
		return INSTRUCTION_NAME;
	}
}